package com.hymjweb.demo.framework.util.util;

import java.util.Vector;

public class VectorParam {
	private Vector<String> vecSQL = new Vector<String>();
	private Vector<Object[]> vecObjParam = new Vector<Object[]>();

	public VectorParam(String psql, Object... args) {
		add(psql, args);
	}

	public VectorParam(String[] psql, Object[][] oPrams) {
		for (int i = 0; i < psql.length; i++) {
			this.vecSQL.add(psql[i]);
			this.vecObjParam.add(oPrams[i]);
		}
	}

	/**
	 * 添加PreparedStatement SQL 语句，并设置参数
	 */
	public void add(String psql, Object... args) {
		this.vecSQL.add(psql);
		Object[] objs = new Object[args.length];
		for (int i = 0; i < args.length; i++) {
			objs[i] = args[i];
		}
		this.vecObjParam.add(objs);
	}

	public Vector<String> getSQL() {
		return this.vecSQL;
	}

	public Vector<Object[]> getParam() {
		return this.vecObjParam;
	}

	public void clear() {
		clearSQL();
		clearParam();
	}

	public void clearSQL() {
		this.vecSQL.clear();
	}

	public void clearParam() {
		this.vecObjParam.clear();
	}

}
